/*
 * @Description: In User Settings Edit
 * @Author: your name
 * @Date: 2019-10-14 18:06:56
 * @LastEditTime: 2019-10-16 18:21:58
 * @LastEditors: Please set LastEditors
 */
let ssqArrs = getAllSSQRedArray();

function getAllSSQRedArray() {
    let arr = [];
    for (let index = 1; index < 34; index++) {
        arr.push[index];
    }
    return arr;
}

/**
 * 
 * @param {获取几注} number 
 * @param {已选择的数组} selectArr 
 */
function getRandomRedNumber(number, selectArr) {
    let rst = [];
    for (let index = 0; index < number; index++) {
        rst.push(getRandomSSQRedNumber(selectArr, 0))
    }
    return rst;
}


function getRandomSSQRedNumber(selectArr, selectNumber) {
    let rst = [];
    //未加异常校验
    let length = selectArr && selectArr.length ? selectArr.length : 0;
    let randomTime = length >= 6 ? 6: 0;
    let number = 0;
    // console.log("randomTime=",randomTime)
    if (randomTime) {
        for (let index = 0; number < 6; index++) {
            var idx = Math.floor(Math.random() * selectArr.length);
            let obj = selectArr[idx];
            if (rst.includes(obj)) {
                continue;
            } else {
                number++;
                rst.push(obj);
                if (number == 6) {
                    break;
                }
            }
        }
    } else {
        // 选择的数据小于6个
        rst = selectArr;
        //去除已存在的
        let filterArr = ssqArrs.filter((value, index, ssqArrs) => {
            return !selectArr.includes(value);
        })
        // console.log("filterArr=",filterArr)
        for (let index = 0; index < 6-length; index++) {
            var idx = Math.floor(Math.random() * filterArr.length);
            let obj = filterArr[idx];
            rst.push(obj);
        }

    }
    return rst;
}